package Math;

public class _171_ExcelSheetColumnNumber {
    public int titleToNumber(String s) {
        int total = 0;
        int pow = 1;
        for (int i = s.length() - 1; i >= 0; i--) {
            total += pow * (s.charAt(i) - 64);
            pow *= 26;
        }
        return total;
    }
}
